1
general::
Do the best one can under given circumstances, as in Since he can't break the contract, Bill's making a virtue of necessity. This expression first appeared in English in Chaucer's The Knight's Tale: "Then is it wisdom, as it thinketh me, to make virtue of necessity." Also see MAKE THE BEST OF.
American Heritage Idioms
2
general::
Phrase(s): make a virtue of necessity
Prov. to do what you have to do cheerfully or willingly. • When Bill’s mother became sick, there was no one but Bill to take care of her, so Bill made a virtue of necessity and resolved to enjoy their time together.
McGrawhill's American Idioms And Phrasal Verbs